{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import tensorflow as tf\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from path_explain import set_up_environment\n",
    "from neural_interaction_detection import NeuralInteractionDetectionExplainerTF\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "set_up_environment(visible_devices='0')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = np.random.randn(100, 2).astype(np.float32)\n",
    "y = x[:, 0] + np.random.randn(100) * 0.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7fb110ddf850>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAVTElEQVR4nO3df4wcd3nH8c/jY0PXgLJpcxLyJq6jFjkiGHLlRKO6f9RAcQrIGKMUKmiFqGRVKhJByMiuEZi2KCedSqkoUmuViD+IwBIxR2giOYkciZY2lDXn4jixUUD8yAaVo/gCjRdyPj/9427Pe3sztzM7szM7M++XhMDrZfe7An30zTPP9/mauwsAUFxb8l4AACAZghwACo4gB4CCI8gBoOAIcgAouBfl8aU33nij79ixI4+vBoDCOnPmzE/dfbL/9VyCfMeOHWq1Wnl8NQAUlp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V0fd/SvuflTSUTM7opX7QD+W6QJTNOi3rr7nqFb+Ue6+LNeWpii/EygaM3uppPsl3d1XLRgLuQa5u78x4lvvk/SQChzkg36rmb1X0lslvcEL3Nwf43/TMmpLurnnzzetvoYCM7OaVkL8Pnc/mfd6goxtjbxK94Ga2Z2SPixpn7tfzns9GNo3Jb3CzG4xs+skvUvSAzmvCQmYmUn6rKSn3P2Tea8nzNie7DSz+yWtuw/U3Uu5uzGzpyW9WNL/rr70uLuX7v5TM3u7pE9LmpS0KOmsu+/Nd1XpMrM3S/qUpAlJ97r7J3Je0kiY2Rck/YFWxrv+j6SPuftnc13UCJjZ70v6N0nntJJFkvRX7v5QfqvaaGyDHAAQzdiWVgAA0RDkAFBwBDkAFBxBDgAFR5ADQMER5ABQcAQ5ABTc/wOKkIcYOnZFBQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x[:, 0], y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = tf.keras.models.Sequential()\n",
    "model.add(tf.keras.layers.Input(shape=(2,)))\n",
    "model.add(tf.keras.layers.Dense(8))\n",
    "model.add(tf.keras.layers.Activation(tf.keras.activations.relu))\n",
    "model.add(tf.keras.layers.Dense(1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<tf.Variable 'dense/kernel:0' shape=(2, 8) dtype=float32, numpy=\n",
       "array([[ 0.6211237 , -0.23568434,  0.29084074, -0.4498317 ,  0.45521545,\n",
       "         0.60068846,  0.42799997, -0.40515453],\n",
       "       [ 0.6728146 ,  0.2501278 ,  0.5524677 ,  0.6578512 , -0.5885768 ,\n",
       "        -0.73645526, -0.07776928, -0.73685455]], dtype=float32)>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.layers[0].weights[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"sequential\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense (Dense)                (None, 8)                 24        \n",
      "_________________________________________________________________\n",
      "activation (Activation)      (None, 8)                 0         \n",
      "_________________________________________________________________\n",
      "dense_1 (Dense)              (None, 1)                 9         \n",
      "=================================================================\n",
      "Total params: 33\n",
      "Trainable params: 33\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 100 samples\n",
      "Epoch 1/10\n",
      "100/100 [==============================] - 0s 2ms/sample - loss: 0.6924\n",
      "Epoch 2/10\n",
      "100/100 [==============================] - 0s 42us/sample - loss: 0.2576\n",
      "Epoch 3/10\n",
      "100/100 [==============================] - 0s 42us/sample - loss: 0.1165\n",
      "Epoch 4/10\n",
      "100/100 [==============================] - 0s 41us/sample - loss: 0.0533\n",
      "Epoch 5/10\n",
      "100/100 [==============================] - 0s 41us/sample - loss: 0.0275\n",
      "Epoch 6/10\n",
      "100/100 [==============================] - 0s 40us/sample - loss: 0.0183\n",
      "Epoch 7/10\n",
      "100/100 [==============================] - 0s 40us/sample - loss: 0.0155\n",
      "Epoch 8/10\n",
      "100/100 [==============================] - 0s 41us/sample - loss: 0.0143\n",
      "Epoch 9/10\n",
      "100/100 [==============================] - 0s 41us/sample - loss: 0.0133\n",
      "Epoch 10/10\n",
      "100/100 [==============================] - 0s 42us/sample - loss: 0.0129\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras.callbacks.History at 0x7fb0d0795910>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.compile(optimizer=tf.keras.optimizers.SGD(learning_rate=0.1),\n",
    "              loss=tf.keras.losses.MeanSquaredError())\n",
    "model.fit(x, y, batch_size=50, epochs=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pred = model.predict(x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7fb0d0656790>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAD4CAYAAADxeG0DAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAWEElEQVR4nO3df4zkdX3H8df71pEOmHShXGoY7jjakjXACRsmSHP9o6Lp4g9wPUqQmjbWJhcTTdTYNUfPyJlquGQTNWn9h0TiH70oVXBFoTklR0NLi3XWhcIBZ1HLj8HUVVk03Ebm9t79Y3eW2dnv9zs/vt+Z+X6+83wkJMyPm/lMkJcf3p/35/MxdxcAIFw7Rj0AAEA6BDkABI4gB4DAEeQAEDiCHAAC97pRfOn555/ve/bsGcVXA0CwFhcXf+HuO9ufH0mQ79mzR7VabRRfDQDBMrNno56ntAIAgSPIASBwBDkABI4gB4DAEeQAEDiCHAACN5L2QwAomoWluuaPndSLK6u6YLKsuZkpzU5XOr6WBYIcAFJaWKrr1nse12pjTZJUX1nVrfc8vvl63GtZhTlBDgApzR87uRnUTauNNc0fO7n591GvEeQAkBMvrqz29Hyn13rFYicApHTBZDn2+aTXskKQA0BKczNTKpcmtjxXLk1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d//hxt//RtJTkoK5xSaoG4LG7KTFD0q6a9SDQFcqkp5vefyCpLeMaCxIycz2SJqW9P3RjqR7uQpyM3tA0hsjXjrk7t9y90OSDpnZrVo/afG2oQ4wA51+48Z7Dmn9P/WODnNsWejm9wF5ZWZvkHS3pI+1VQFyLVdB7u5v7/KtRyXdrwCDvNNvNLMPSHq3pLd5gE3+PfwzLJK6pF0tjy/ceA4BMbOS1kP8qLvfM+rx9CKYGrmZXdLysOuTFkNiZtdJ+qSkG9z91KjHg679QNIlZnaxmb1e0vsk3TviMaEHZmaSvizpKXf//KjH06tgdnYO66TFUTKzZySdJemXG0894u4fGuGQMmVm75X0D5J2SlqR9Ki7z4x2VNkws3dK+qKkCUl3uvvnRjykTJnZVyX9qdaPeP0/Sbe5+5dHOqgMmdmfSPo3SY9rPWMk6e/c/f7Rjap7wQQ5ACBaMKUVAEA0ghwAAkeQA0DgCHIACBxBDgCBI8gBIHAEOQAE7v8Bkb+IIEMYz4kAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(y, y_pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "explainer = NeuralInteractionDetectionExplainerTF(model)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "\n",
      "\n",
      "100%|██████████| 2/2 [00:00<00:00, 1019.15it/s][A\n"
     ]
    }
   ],
   "source": [
    "interactions = explainer.interactions(inputs=x,\n",
    "                                      batch_size=50,\n",
    "                                      output_index=0,\n",
    "                                      verbose=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7fb0d0656e10>"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAczUlEQVR4nO3df4wc9Znn8feHYSBDEmXYMNrAYMfcJTIKYcFhxJKzdAqOsiaENV5+CPb2smFF5ON2UZZczndmdYLAPzhnKb+WaCMfoIW9KPEuWF4TiCwks8oGLWzG2AYc8MoXsgsDEhPAJoSBjM1zf3SPPe7p6qqeru6uqv68pBE93eXqb5eGp7/11PN9ShGBmZmV3wn9HoCZmeXDAd3MrCIc0M3MKsIB3cysIhzQzcwq4sR+vfFpp50Wy5Yt69fbm5mV0q5du34ZEWPNXssc0CUNAZPAVERc1vDaycB9wAXAq8A1EfGLVvtbtmwZk5OTWd/ezMwASf+a9Fo7KZc/B55NeO164PWI+AjwDeBrbezXzMxykCmgSzoT+BxwV8ImlwP31h/fD3xakjofnpmZZZV1hv5N4H8A7ya8Pg68ABARh4FDwAcbN5K0TtKkpMnp6elFDNfMzJKkBnRJlwGvRMSuTt8sIjZHxERETIyNNc3pm5nZImWZoa8E1kj6BfADYJWk/9uwzRSwBEDSicAHqF0cNTOzHkkN6BFxc0ScGRHLgGuBnRHxnxs22w58of74qvo27vplZtZDi65Dl3Q7MBkR24G7gb+RdAB4jVrgNzMzYNvuKTbt2M9LB2c4Y3SE9auXs3bFeO7v01ZAj4h/AP6h/viWec+/DVyd58DMzKpg2+4pbt76NDOzRwCYOjjDzVufBsg9qHvpv5lZF23asf9oMJ8zM3uETTv25/5efVv6b2bF0Kt0wKB66eBMW893wjN0swE2lw6YOjhDcCwdsG33VL+HVhlnjI609XwnHNDNBlgv0wGDav3q5YwMDx333M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pIt7o93iyKnJAb+depvTiXqYFknpsIuLViHin/utdwAU9GltZZPn7GkgR8UZEvFl//DAwLOm0Pg+rZyQNUwvm34uIrU02KezfTpEDuu9lmiz12DTk9NZQywXaMduBP65XLFwEHIqIl/s9qCKQ9KG5a1GSLqQWJwZhokT9c98NPBsRX0/YrLB/O5luQdcP4XuZJsp4bL4kaQ1wmNqxua5vA+4DSd+nVq1xmqQXgVuBYYCI+C61WypeChwA3gL+pD8j7b0Mx+Yq4L9KOgzMANcOyEQJYCXweeBpSXvqz/0FsBSK/7fjpf9mZhVR5JSLmZm1wQHdzKwiHNDNzCrCAd3MrCIc0M3MKsIB3cysIhzQzcwq4v8DpUt521XwDTYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(np.minimum(np.abs(x[:, 0]), np.abs(x[:, 1])), interactions[:, 0, 1])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
